package com.func.domain.strategy.model.entity;

import com.func.domain.strategy.model.valobj.RuleLogicCheckTypeVO;
import lombok.*;

/**
 * @ClassName RuleActionEntity
 * @Description 过滤器返回的检索的到的过滤动作
 * @Author: func
 * @Date 2025/2/26 8:38
 * @Version 1.0
 */

@Data
@AllArgsConstructor
@NoArgsConstructor
@Builder
public class RuleActionEntity<T extends RuleActionEntity.RaffleEntity> {

    /**
     * 默认放行
     */
    private String code = RuleLogicCheckTypeVO.ALLOW.getCode();
    private String info = RuleLogicCheckTypeVO.ALLOW.getInfo();
    /**
     * 过滤规则
     */
    private String ruleModel;
    /**
     * 过滤的data, 用来装具体这个过滤行为发生的时机对应的子类中的信息
     */
    private T data;
    static public class RaffleEntity {

    }

    @EqualsAndHashCode(callSuper = true)
    @Data
    @AllArgsConstructor
    @NoArgsConstructor
    @Builder
    // 抽奖前
    static public class RaffleBeforeEntity extends RuleActionEntity.RaffleEntity{
        /**
         * 策略Id
         */
        private Long strategyId;
        /**
         * 权重值key: 用于抽奖的时候可以选择权重抽奖
         */
        private String ruleWeightValueKey;
        /**
         * 奖品Id
         */
        private Integer awardId;
    }
    // 抽奖中
    static public class RaffleCenterEntity extends RuleActionEntity.RaffleEntity{

    }
    // 抽奖后
    static public class RaffleAfterEntity extends RuleActionEntity.RaffleEntity{

    }
}